<?php /* Smarty version 2.6.18, created on 2010-03-16 11:25:55
         compiled from dispatchorderdetail.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'dispatchorderdetail.tpl', 25, false),)), $this); ?>
<div id="blanket" style="display:none;"></div>
<div id="tank" style="position:absolute;background-color:#fff;width:400px;z-index: 1002;display:none;">
</div>
<div id="addItem" style="position:absolute;background-color:#fff;width:400px;z-index: 1002;display:none;">
</div>
<script>
	var dd = new ekimo_drag_region("content","tank");
</script>
<div class="white">
<table border="0" width="100%">
		<tr>
			<td>Image</tD>
			<td>MOID</tD>
			<td>Common Name</tD>
			<td></td>
			<td>Size</tD>
			<td>Age</tD>
			<td>Sub-Total</tD>
			<td>Qty. Dispatch</tD>
		</tr>
		<tr>
			<td colspan="8"><hr></td>
		</tr>
		<?php $_from = $this->_tpl_vars['orders']['0']['details']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
		<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
			<td align="center"><img  onclick="PopEx(this, null, null, null, 300, 50, 'PopBoxImageLarge');" pbCaption="<i><?php echo $this->_tpl_vars['item']['scientific_name']; ?>
</i>, <?php echo $this->_tpl_vars['item']['common_name']; ?>
" id="trade<?php echo $this->_tpl_vars['item']; ?>
" width="50" src="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['item']['image']; ?>
.jpg" pbsrc="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['item']['image']; ?>
.jpg" class="PopBoxImageSmall" title="Click to magnify/shrink"></td>
			<td><?php echo $this->_tpl_vars['item']['moid']; ?>
</td>
			<td><i><?php echo $this->_tpl_vars['item']['scientific_name']; ?>
</i><br><?php echo $this->_tpl_vars['item']['common_name']; ?>
</td>
			<td><input type="button" value="Tank" onclick="opentank('<?php echo $this->_tpl_vars['item']['moid']; ?>
','<?php echo $this->_tpl_vars['item']['size_code']; ?>
');" ></td>
			<td><?php echo $this->_tpl_vars['item']['size']; ?>
</td>
			<td></td>
			<td align="right" style="padding-right:10px"><?php echo $this->_tpl_vars['item']['balance']; ?>
</td>
			<td align="right" style="padding-right:10px"><?php echo $this->_tpl_vars['item']['qtydispatch']; ?>
</td>
			
		</tr>
		<?php endforeach; endif; unset($_from); ?>
	
		
</table>
</div>
<div class="content">
	<p><input type="button" value="Add Organism" onclick="addDispatchOrganism();">&nbsp;<input type="button" value="Save" onclick="savedispatch();"></p>
</div>
<script language="javascript">
<?php echo '
	function opentank(moid,sizecode){
		doajaxAction("/account/tankinventory/poid/'; ?>
<?php echo $this->_tpl_vars['poid']; ?>
<?php echo '/customerId/'; ?>
<?php echo $this->_tpl_vars['customerId']; ?>
<?php echo '/moid/"+moid+"/sizecode/"+sizecode,0,\'tank\');
		popup("tank");
	}
	function savedispatch(){
		doajaxAction("/account/savedispatch/poid/'; ?>
<?php echo $this->_tpl_vars['poid']; ?>
<?php echo '/customerId/'; ?>
<?php echo $this->_tpl_vars['customerId']; ?>
<?php echo '",1,\'main_content\',document.getElementById(\'mainForm\'));
	}
	
	function addDispatchOrganism(){
		doajaxAction("/account/addNewDispatch/poid/'; ?>
<?php echo $this->_tpl_vars['poid']; ?>
<?php echo '/customerId/'; ?>
<?php echo $this->_tpl_vars['customerId']; ?>
<?php echo '",0,\'addItem\');
		popup(\'addItem\');	
	}
	
'; ?>

</script>